package com.ophiux.system.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ophiux.common.core.base.Result;
import com.ophiux.common.core.constant.SecurityConstants;
import com.ophiux.common.log.annotation.ExtSysLog;
import com.ophiux.common.security.annotation.Inner;
import com.ophiux.system.model.entity.SysOauthClientDetails;
import com.ophiux.system.service.SysOauthClientDetailsService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/client")
@Api(value = "client", tags = "客户端管理模块")
public class SysClientController {

	@Autowired
	private SysOauthClientDetailsService clientDetailsService;

	@GetMapping("/getClientDetailsById/{clientId}")
	@Inner
	@ExtSysLog(value = "查询客户端用户信息")
	public Result<SysOauthClientDetails>  getClientDetailsById(@PathVariable String clientId, @RequestHeader(SecurityConstants.FROM) String from) {
		return Result.success(clientDetailsService.getOne(Wrappers.<SysOauthClientDetails>lambdaQuery().eq(SysOauthClientDetails::getClientId, clientId), false));
	}

}
